#ifndef _IEWEBBROWSER_H_
#define _IEWEBBROWSER_H_

#include "ieobj.h"
#include "iedwebbrowserevents2.h"
#include "iewebeventhandler.h"

class CIWebBrowser2Impl :	public IServiceProvider,
							public IOleCommandTarget,
							public IInternetSecurityManager,
							public CIEWebEventHandlerImpl,
							public CDWebBrowserEvents2Impl

{
public:	
	CIWebBrowser2Impl();
	~CIWebBrowser2Impl();

public:

//IUnknown
//////////////////////////////////////////////////////////////////////////////
	HRESULT STDMETHODCALLTYPE QueryInterface(
		/* [in] */ REFIID riid,
		/* [iid_is][out] */ _COM_Outptr_ void __RPC_FAR *__RPC_FAR *ppvObject);
	ULONG STDMETHODCALLTYPE AddRef(void);
	ULONG STDMETHODCALLTYPE Release(void);
//IServiceProvider
//////////////////////////////////////////////////////////////////////////////
	 HRESULT STDMETHODCALLTYPE QueryService(
		/* [in] */ _In_ REFGUID guidService,
		/* [in] */ _In_ REFIID riid,
		/* [out] */ _Outptr_ void __RPC_FAR *__RPC_FAR *ppvObject);

//IOleCommandTarget
//////////////////////////////////////////////////////////////////////////////
	 HRESULT STDMETHODCALLTYPE QueryStatus(
		 /* [unique][in] */ __RPC__in_opt const GUID *pguidCmdGroup,
		 /* [in] */ ULONG cCmds,
		 /* [out][in][size_is] */ __RPC__inout_ecount_full(cCmds) OLECMD prgCmds[],
		 /* [unique][out][in] */ __RPC__inout_opt OLECMDTEXT *pCmdText);

	 HRESULT STDMETHODCALLTYPE Exec(
		 /* [unique][in] */ __RPC__in_opt const GUID *pguidCmdGroup,
		 /* [in] */ DWORD nCmdID,
		 /* [in] */ DWORD nCmdexecopt,
		 /* [unique][in] */ __RPC__in_opt VARIANT *pvaIn,
		 /* [unique][out][in] */ __RPC__inout_opt VARIANT *pvaOut);

//IInternetSecurityManager
//////////////////////////////////////////////////////////////////////////////
	 HRESULT STDMETHODCALLTYPE SetSecuritySite(
		 /* [unique][in] */ __RPC__in_opt IInternetSecurityMgrSite *pSite);

	 HRESULT STDMETHODCALLTYPE GetSecuritySite(
		 /* [out] */ __RPC__deref_out_opt IInternetSecurityMgrSite **ppSite);

	 HRESULT STDMETHODCALLTYPE MapUrlToZone(
		 /* [in] */ __RPC__in LPCWSTR pwszUrl,
		 /* [out] */ __RPC__out DWORD *pdwZone,
		 /* [in] */ DWORD dwFlags);

	 HRESULT STDMETHODCALLTYPE GetSecurityId(
		 /* [annotation][in] */
		 _In_  LPCWSTR pwszUrl,
		 /* [annotation][size_is][out] */
		 _Out_writes_bytes_to_(MAX_SIZE_SECURITY_ID, *pcbSecurityId)  BYTE *pbSecurityId,
		 /* [annotation][out][in] */
		 _Inout_ _At_(*pcbSecurityId, _In_range_(>= , MAX_SIZE_SECURITY_ID) _Out_range_(0, MAX_SIZE_SECURITY_ID))  DWORD *pcbSecurityId,
		 /* [annotation][in] */
		 _In_  DWORD_PTR dwReserved);

	 HRESULT STDMETHODCALLTYPE ProcessUrlAction(
		 /* [in] */ __RPC__in LPCWSTR pwszUrl,
		 /* [in] */ DWORD dwAction,
		 /* [size_is][out] */ __RPC__out_ecount_full(cbPolicy) BYTE *pPolicy,
		 /* [in] */ DWORD cbPolicy,
		 /* [unique][in] */ __RPC__in_opt BYTE *pContext,
		 /* [in] */ DWORD cbContext,
		 /* [in] */ DWORD dwFlags,
		 /* [in] */ DWORD dwReserved);

	 HRESULT STDMETHODCALLTYPE QueryCustomPolicy(
		 /* [in] */ __RPC__in LPCWSTR pwszUrl,
		 /* [in] */ __RPC__in REFGUID guidKey,
		 /* [size_is][size_is][out] */ __RPC__deref_out_ecount_full_opt(*pcbPolicy) BYTE **ppPolicy,
		 /* [out] */ __RPC__out DWORD *pcbPolicy,
		 /* [in] */ __RPC__in BYTE *pContext,
		 /* [in] */ DWORD cbContext,
		 /* [in] */ DWORD dwReserved);

	 HRESULT STDMETHODCALLTYPE SetZoneMapping(
		 /* [in] */ DWORD dwZone,
		 /* [in] */ __RPC__in LPCWSTR lpszPattern,
		 /* [in] */ DWORD dwFlags);

	 HRESULT STDMETHODCALLTYPE GetZoneMappings(
		 /* [in] */ DWORD dwZone,
		 /* [out] */ __RPC__deref_out_opt IEnumString **ppenumString,
		 /* [in] */ DWORD dwFlags);

private:
	WebUI * m_pwebui;
	LONG	m_dwRef;
};


#endif 